home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 November / Chip_1999-11_cd.bin / zkuste / MacOS / DATA / FILES / POWER64.HQX / Power64 2.5.1 / Power64 2.5.1 - Read Me.rsrc / TEXT_139.txt < prev    next >
Text File  |  1999-09-20  |  9KB  |  186 lines

  1. Appendix B : List of Floppy Disk Commands
  2.  
  3. The 1541 Disk Drive is a flexible device in itself, containing a CPU, RAM and ROM it is a small computer that can execute many commands.
  4.  
  5. Use the following program to send the command to the floppy.
  6. 10 OPEN 1, 8, 15                  ; Open Command Channel
  7. 20 PRINT#1, Command$              ; Send Command
  8. 30 CLOSE 1                        ; Close Channel
  9.  
  10. With the following program you can display the current floppy status.
  11. 10 OPEN 1, 8, 15                  ; Open Error Channel
  12. 20 INPUT#1, EN$, ER$, TR$, SC$    ; Read Message
  13. 30 CLOSE 1                        ; Close Channel
  14. 40 PRINT "ErrNr: "; EN$           ; Display Results
  15. 50 PRINT "Error: "; ER$
  16. 60 PRINT "Track: "; TR$
  17. 70 PRINT "Sector:"; SC$
  18.  
  19. Power64 emulates the following commands for the emulated Commodore 1541 disk drives:
  20.  
  21. NEW - Format a floppy disk
  22.   Abbreviation: N
  23.   Syntax: "NEW:<diskname>,<id>"
  24.       Where <diskname> can be up to 16 characters long and <id> can either
  25.       be omitted (only the directory is erased on a pre-formatted disk) or
  26.       must be exactly 2 characters long.
  27.  
  28. COPY - Create a copy of a file on the same disk
  29.   Abbreviation: C
  30.   Syntax: "COPY:<destfile>=<sourcefile>" or
  31.           "COPY:<destfile>=<sourcefile1>, <sourcefile2>, ..."
  32.       If several source files are listed, than the destination file will
  33.       contain the concatenated contents of all source files.
  34.  
  35. RENAME - Rename a file
  36.   Abbreviation: R
  37.   Syntax: "RENAME:<newname>=<oldname>"
  38.  
  39. SCRATCH - Delete files
  40.   Abbreviation: S
  41.   Syntax: "SCRATCH:<file>"
  42.       You can use the wild cards '?' and '*' to delete several files at once.
  43.  
  44. INITIALIZE - Reset the C1541 to power-up condition
  45.   Abbreviation: I
  46.   Syntax: "INITIALIZE"
  47.  
  48. VALIDATE - Check and Fix Disk Consistency
  49.   Abbreviation: V
  50.   Syntax: "VALIDATE"
  51.       Validate will fix inconsistencies that can be caused by files that
  52.       where opened but never closed. Beware: Validate also erases all
  53.       random files!
  54.  
  55. POSITION - Change the Read/Write Position in a Relative File
  56. Abbreviation: P
  57. Syntax: "P"+CHR$(Channel)+CHR$(RecLow)+CHR$(RecHi)+CHR$(Pos) 
  58.     OPEN 15, 8, 15            ; Open Command Channel
  59.     OPEN  5, 8, 5, "RelativeFile,L,";CHR$(40)
  60.                               ; Create Relative File with Recordsize
  61.                               ; 40 Byte
  62.     PRINT#15,"P"+CHR$(5)+CHR$(17)+CHR$(0)+CHR$(1)
  63.                               ; Set File Position to 1st Byte of
  64.                               ; Record 17 (Numbering for Records and 
  65.                               ; BytePos starts with 1 (not 0))
  66.     PRINT#5,"Important Data"  ; Write Data
  67.     PRINT#15,"P"+CHR$(5)+CHR$(9)+CHR$(0)+CHR$(4)
  68.                               ; Set File Position to 4th Byte of
  69.                               ; Record 9 (Numbering for Records and 
  70.                               ; BytePos starts with 1 (not 0))
  71.     INPUT#5,X$                ; Read Data
  72.     CLOSE 5                   ; Close Channel
  73.     CLOSE 15                  ; Close Command Channel
  74.  
  75. BLOCK-READ - Read a Disk Block into the internal floppy RAM
  76.   Abbreviation: B-R
  77.   Syntax: "B-R:"+STR$(Channel)+STR$(Drive)+STR$(Track)+STR$(Sector)
  78.   Example:
  79.     OPEN 15, 8, 15            ; Open Command Channel
  80.     OPEN  5, 8, 5, "#"        ; Open Channel 5 to RAM buffer
  81.     PRINT#15,"B-R: 5 0 18 2"  ; Read Track 18 / Sector 2 into the buffer
  82.                                 for channel 5
  83.     PRINT#15,"B-P: 5 0"       ; Place Pointer at start of block
  84.     FOR I = 0 TO 253          ; One Block is max. 254 Byte
  85.     GET#5, A$                 ; Get another Byte
  86.     IF (ST <> 0) THEN ...     ; Check for End of Block
  87.        ...                    ; Process Byte
  88.     NEXT I
  89.     CLOSE 5                   ; Close Channel
  90.     CLOSE 15                  ; Close Command Channel
  91.  
  92. BLOCK-WRITE - Write a Disk Block from the internal floppy RAM
  93.   Abbreviation: B-W
  94.   Syntax: "B-W:"+STR$(Channel)+STR$(Drive)+STR$(Track)+STR$(Sector)
  95.   Example:
  96.      OPEN 15, 8, 15            ; Open Command Channel
  97.     OPEN  5, 8, 5, "#"        ; Open Channel 5 to RAM buffer
  98.     PRINT#5, X$               ; Write some string
  99.     PRINT#5, Y$               ; Write another string
  100.     PRINT#5, Z$               ; Write yet another string
  101.                                             (total: max. 254 Byte)
  102.     PRINT#15,"B-W: 5 0 18 2"  ; Write Track 18 / Sector 2 from
  103.                                           the buffer for channel 5
  104.     CLOSE 5                   ; Close Channel
  105.     CLOSE 15                  ; Close Command Channel
  106.  
  107. BUFFER-POINTER - Set the pointer for a buffered block
  108.   Abbreviation: B-P
  109.   Syntax: "B-P:"+STR$(Channel)+STR$(Pos)
  110.   Example: see BLOCK-READ
  111.  
  112. BLOCK-ALLOCATE - Mark a disk block as used
  113.   Abbreviation: B-A
  114.   Syntax: "B-A:"+STR$(Drive)+STR$(Track)+STR$(Sector)
  115.   Example:
  116.    OPEN 1, 8, 15                ; Open Command Channel
  117.    PRINT#1,"B-A: 0 12 7"        ; Allocate Block at Track 12 Sector 7
  118.    INPUT#1, EN$, ER$, TR$, SC$  ; Get the sector that was allocated
  119.    CLOSE 1                      ; Close Command/Error Channel
  120.    PRINT "Track:;TR$;"Sector";SC$
  121.  
  122. BLOCK-FREE - Mark a disk block as unused
  123.   Abbreviation: B-F
  124.   Syntax: "B-F:"+STR$(Channel)+STR$(Pos)
  125.   Example:
  126.     OPEN 1, 8, 15                ; Open Command Channel
  127.     PRINT#1,"B-F: 0 12 7"        ; Free Block at Track 12 Sector 7
  128.     CLOSE 1                      ; Close Command/Error Channel
  129.  
  130. BLOCK-EXECUTE - Read a Disk Block into the internal floppy and execute it.   Abbreviation: B-E
  131.   Syntax: "B-E:"+STR$(Channel)+STR$(Drive)+STR$(Track)+STR$(Sector)
  132.   Note: Block Execute obviously requires the complete emulation of the MOS 6502 CPU in the 1541. If you wish to use this command make sure that the Complete Floppy 1541 Emulation is enabled. Otherwise you will get a 'Command Not Emulated' Error Message.
  133.  
  134. USER1 - Read a Disk Block to the internal floppy RAM
  135.   Abbreviation: U1
  136.   USER1 works like BLOCK-READ with the exception that U1 considers the
  137.   link to the next block to be part of the data. Thus a block read with
  138.   U1 will be 256 (rather than max. 254) bytes long.
  139.  
  140. USER2 - Write a Disk Block from the internal floppy RAM
  141.   Abbreviation: U2
  142.   USER2 works like BLOCK-WRITE with the exception that U2 considers the
  143.   link to the next block to be part of the data. Thus a block written with
  144.   U2 has to be 256 (rather than max. 254) bytes long.
  145.  
  146. USER3..USER8 - Execute a User Program on the Floppy
  147.   Abbreviation: U3..U8
  148. Program execution starts at $0500 + 3*(x-3) (i.e. $0500 for U3, $0503 for U4...)
  149.   Note: Block Execute obviously requires the complete emulation of the MOS 6502 CPU in the 1541. If you wish to use this command make sure that the Complete Floppy 1541 Emulation is enabled. Otherwise you will get a 'Command Not Emulated' Error Message.
  150.  
  151. USERI - Switch the C1541 between C64 to VC20 mode
  152.   Abbreviation: UI
  153.   Syntax: "UI+" or "UI-"
  154.   This is a dummy function in Power64. It causes a slight adjustment of
  155.   transfer speeds on a real C1541
  156.  
  157. USERJ - Reset the C1541 to power-up condition
  158.   Abbreviation: UJ
  159.   Syntax: "UJ"
  160.   Substitute for INITIALIZE
  161.  
  162. MEMORY-READ - Read Data from the floppy RAM
  163.   Abbreviation: M-R (You must use the abbreviation, the full form is not legal).
  164.   Syntax: "M-R"+CHR$(LowAddress)+CHR$(HighAddress)+CHR$(Size)
  165.   Example:
  166.      OPEN 1, 8, 15                      ; Open Command Channel
  167.     PRINT#1, "M-R"+CHR$(52)+CHR$(18)+CHR$(3) ; Specify 3 Bytes 
  168.                                        ; starting at Addr. $1234
  169.     GET#1, A$, B$, C$                  ; Get all the Values at once!
  170.     CLOSE 1                            ; Close Channel
  171.  
  172. MEMORY-WRITE - Write Data to the floppy RAM
  173.   Abbreviation: M-W (You must use the abbreviation, the full form is not legal).
  174.   Syntax: "M-W"+CHR$(LowAddress)+CHR$(HighAddress)+CHR$(Size)
  175.   Example:
  176.      OPEN 1, 8, 15                 ; Open Command Channel
  177.     PRINT#1, "I"                  ; Initialize Floppy first !
  178.     PRINT#1, "M-W"+CHR$(52)+CHR$(18)+CHR$(8)
  179.                                   ; Specify Addr. $1234 and 8 Byte
  180.     PRINT#1, "POWER64"            ; Write 8 Byte (incl. CR)
  181.     CLOSE 1                       ; Close Channel
  182.  
  183. MEMORY-EXECUTE - Run a User Program on the Floppy
  184.   Abbreviation: M-E (You must use the abbreviation, the full form is not legal).
  185.   Syntax: "M-E"+CHR$(LowAddress)+CHR$(HighAddress)
  186.   Note: Memory Execute obviously requires the complete emulation of the MOS 6502 CPU in the 1541. If you wish to use this command make sure that the Complete Floppy 1541 Emulation is enabled. Otherwise you will get a 'Command Not Emulated' Error Message.